/**
 * TO BE DETERMINED
 */
package org.eichar.client;

import org.eichar.client.question.TranslationDataEntry;

import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.StackPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

/**
 * Class Generates the UI for entering translations and questions.
 * 
 * @author Jesse
 */
public class DataEntry {

    private I18N i18n;

    private WidgetFactory widgetFactory;

    /**
     * @param i18n
     */
    public DataEntry(I18N i18n, WidgetFactory widgetFactory) {
        this.i18n = i18n;
        this.widgetFactory = widgetFactory;
    }

    /**
     * Creates a widget for Data Entry
     * 
     * @return
     */
    public Widget getWidget() {
        VerticalPanel mainPanel = widgetFactory.createVerticalPanel();

        LanguageConstants constants = i18n.getConstants();

        StackPanel entryPanel = widgetFactory.createStackPanel();
        entryPanel.setWidth("100%"); //$NON-NLS-1$

        // TODO add option to add language table
        TranslationDataEntry translationDataEntry = new TranslationDataEntry(
                i18n, widgetFactory);
        entryPanel.add(translationDataEntry, constants.translationDataEntry());

        // TODO add conjugation panel
        entryPanel.add(new Label(constants.notImplemented()), constants
                .conjugationDataEntry());

        // TODO add generic question panel
        entryPanel.add(new Label(constants.notImplemented()), constants
                .generalDataEntry());

        mainPanel.add(entryPanel);

        return mainPanel;
    }

}
